package export.monster
{
	
	
	import com.game.data.constant.GameProcess;
	
	import com.game.engine.MainGame;
	import com.game.proxy.GameProcessProxy;
	import com.game.view.component.TransDoor;
	
	public class Monster405 extends BaseMonster
	{
		//红孩儿
		public function Monster405()
		{
			super();
			this.attackBackInfoDict["hit1"] = {
				"hitMaxCount":30,
				"attackBackSpeed":[6,-5],
				"attackInterval":4,
				"attackKind":"physics"
			};
			this.attackBackInfoDict["hit2"] = {
				"hitMaxCount":30,
				"attackBackSpeed":[2,-7],
				"attackInterval":4,
				"powerTimes":2.5,
				"attackKind":"magic"
			};
			this.attackBackInfoDict["hit3"] = {
				"hitMaxCount":40,
				"attackBackSpeed":[2,-4],
				"attackInterval":999,
				"powerTimes":2,
				"attackKind":"magic"
			};
			this.attackBackInfoDict["hit4"] = {
				"hitMaxCount":30,
				"attackBackSpeed":[8,-2],
				"attackInterval":4,
				"powerTimes":5,
				"attackKind":"magic"
			};
		}
		
		override protected function beforeSkill1Start():Boolean
		{
			return this.hasTarget() && AUtils.GetDisBetweenTwoObj(this, this.curAttackTarget) < 300;
		}
		
		override protected function beforeSkill2Start():Boolean
		{
			return this.hasTarget() && AUtils.GetDisBetweenTwoObj(this,this.curAttackTarget) < 500;
		}
		
		override protected function beforeSkill3Start():Boolean
		{
			return this.hasTarget() && AUtils.GetDisBetweenTwoObj(this,this.curAttackTarget) < 500;
		}
		
		override protected function releSkill1():void
		{
			this.setAction("hit2");
		}
		
		override protected function releSkill2():void
		{
			this.setAction("hit3");
		}
		
		override protected function releSkill3():void
		{
			this.setAction("hit4");
		}
		
		override public function isAttacking():Boolean
		{
			return this.curAction == "hit1" || this.curAction == "hit2" ||this.curAction == "hit3" ||this.curAction == "hit4";
		}
		
		override protected function myIntelligence():void
		{
			if(!isAttacking())
			{
				super.myIntelligence();
			}
		}
		
		override public function destroy():void
		{
			super.destroy();
			if(this.getHp() <= 0 && MainGame.getIns().levelData.levelID == "4_1")
			{
				GameProcessProxy.achieveProcess(GameProcess.KILL_BISON_DEVIL);
				var door:TransDoor = new TransDoor();
				door.x = 1500;
				door.y = 450;
				gc.pWorld.getTransferDoorArray().push(door);
				gc.gameScene.addChild(door);
				MainGame.getIns().battleData.doorShowed = false;
			}
		}
	}
}